<?php

/**
 * 调用service后的result类
 * Class Fend_Service_Result
 */
class Fend_Service_Result
{
    private $result = null;

    public function __construct($result)
    {
        $this->result = $result;
    }

    public function isOk()
    {
        if ( isset($this->result["stat"]) && $this->result["stat"] != 1 ) {
            return false;
        }
        return true;
    }

    public function getData()
    {
        return $this->result["data"];
    }

    public function getMessage()
    {
        return $this->result["msg"];
    }

    public function getStat()
    {
        return $this->result["stat"];
    }

    public function getBackTrace()
    {
        return $this->result["backtrace"] ?? '';
    }
}